#ifndef __WINDOW_H_
#define __WINDOW_H_

#include <ZWidget.h>
#include <qwidget.h>
#include <qlabel.h>
#include <qpixmap.h>
#include <qcolor.h>
#include <qpainter.h>
#include <qvaluelist.h>
#include <qpointarray.h>

#define CGREEN	QColor(0, 255, 0)
#define CRED	QColor(255, 0, 0)
#define CBLUE	QColor(0, 0, 255)
#define CWHITE	QColor(255, 255, 255)
#define CBLACK	QColor(0, 0, 0)

#define BODYCOUNT 		100;
#define B2_ITERATIONS	10;
#define B2_TIMESTEP 	(1.0f / 30.0f);

#include "sprite.h"
#include <Box2D.h>

#include<iostream>
using namespace std;
typedef QValueList<Sprite *> SpriteList;
class Window : public ZWidget
{
	public:
		Window();
		~Window();
		virtual void paintEvent(QPaintEvent *e);
	private:
		void initB2World();
		void initSprites();
		void updateOneFrame();
		BoxSprite *boxdown,*boxleft,*boxright;
		BoxSprite *boxObject;
		BoxSprite *boxObject2;
		EllipseSprite *ell;
		PolySprite *poly;
		QPixmap pixbuffer;
		SpriteList mlist;
		int timerID;
		b2World *_world;
		b2Body *groundBody;
		b2Body *boxBody,*boxBody2;// my box object
    protected:
		void timerEvent(QTimerEvent *e);
};

#endif /* __WINDOW_H_ */

